<?php


namespace app\admin\model;

use think\Model;

class RealModel extends Model
{

    protected $name = 'users_idcard';
    public static function getList($field ="*",$limit=10,$where=[]){
        return self::where($where)
                ->field($field)
                ->order('create_time','desc')
                ->paginate($limit,[]);
    }
    public static function getInfoById($id){
        return self::where(['card.id'=>$id])
            ->alias('card')
            ->field("
                card.id,
                card.user_telephone,
                card.status,
                card.true_name,
                card.sex,
                card.hand_card,
                card.front,
                card.back,
                card.create_time,
                card.admin_remarks,
                card.IDCard")
//
            ->find();
    }
    public static function getInfo($id,$field){
        return self::where(['id'=>$id])->field($field)->find();
    }
    public static function setReal($id,$status,$admin_remarks){
        return self::where(['id'=>$id])->update(
            [
                "status"=>$status,
                'admin_remarks'=>$admin_remarks
            ]
        );
    }
}